package com.deke.course.service.Impl;

import com.deke.course.dao.CourseShouCangDao;
import com.deke.course.service.CourseShouCangService;
import com.deke.entity.TbShoucangCourse;
import com.deke.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @author ：ludi（206913808@qq.com）
 * @date ：Created in 2022/12/28 13:29
 * @description：
 * @modified By：
 * @version:
 */
@Service
public class CourseShouCangServiceImpl implements CourseShouCangService {

    @Autowired
    private CourseShouCangDao courseShouCangDao;
    /**
     * @create by: ludi（206913808@qq.com）
     * @description: 判断是否收藏
     * @create time: 2022/12/28 13:29
     * @param
     * @return com.deke.vo.Result
     */
    @Override
    public Result findFavoriteCourse() {
        return null;
    }

    /**
     * @create by: ludi（206913808@qq.com）
     * @description: 添加收藏
     * @create time: 2022/12/28 14:16
     * @param
     * @return com.deke.vo.Result
     */
    @Override
    public Result addFavoritescourse(HttpServletRequest request, TbShoucangCourse tbShoucangCourse) {
        /*HttpSession session= request.getSession();
        session.setAttribute("courseid",tbShoucangCourse.getCourseId());
        session.setAttribute("memberid",tbShoucangCourse.getMemberId());*/
        tbShoucangCourse.setCourseId(tbShoucangCourse.getCourseId());
        tbShoucangCourse.setMemberId(tbShoucangCourse.getMemberId());
        tbShoucangCourse.setStatus(1);
        return new Result(2000,"收藏成功",tbShoucangCourse);
    }
}